x86/mm: fix 32-bit p2m type lookups
authorTim Deegan <Tim.Deegan@citrix.com>
Fri, 8 Jul 2011 10:44:23 +0000 (11:44 +0100)
committerTim Deegan <Tim.Deegan@citrix.com>
Fri, 8 Jul 2011 10:44:23 +0000 (11:44 +0100)
23300:4b0692880dfa moved a check for 0 into p2m_flags_to_type()
and removed it from its caller, but the new check is only
compiled in 64-bit builds.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/include/asm-x86/p2m.h

index dad0f348073f9bb146d4da309379b7dd8d3c3cbb..e4c118ce46392e4f6aec403f03f0513f34cd9193 100644 (file)
@@ -597,12 +597,11 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
 /* Extract the type from the PTE flags that store it */
 static inline p2m_type_t p2m_flags_to_type(unsigned long flags)
 {
-    /* Type is stored in the "available" bits */
-#ifdef __x86_64__
     /* For AMD IOMMUs we need to use type 0 for plain RAM, but we need
      * to make sure that an entirely empty PTE doesn't have RAM type */
     if ( flags == 0 ) 
         return p2m_invalid;
+#ifdef __x86_64__
     /* AMD IOMMUs use bits 9-11 to encode next io page level and bits
      * 59-62 for iommu flags so we can't use them to store p2m type info. */
     return (flags >> 12) & 0x7f;